﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using PureMVC.Patterns;
using PureMVC.Interfaces;
using GameEngine.Clients.Silverlight.View;
using MySettlers.Screens;
using GameEngine.Model.Data;

namespace MySettlers.Commands
{
    public class Page_WorldEditor_In_Command : SimpleCommand
    {
        override public void Execute(INotification notification)
        {
            //ILevelVO<int> level = (ILevelVO<int>)notification.Body;
            //if (level == null) {
            //    level = new LevelVO<int>(n);
            //}
            //MenuMediator editorMediator = new MenuMediator(MyFacade.EditorPageMediatorName, new EditorMainMenu(), MyFacade.PAGE_EDITORMAINMENU_OUT_COMMAND);
            //MyFacade.Instance.RegisterMediator(editorMediator);
            //MyFacadeHelper.DesktopNavigate(editorMediator.ViewComponent);
            //IGameVO<int> game = notification.Body as IGameVO<int>;
            /*
            EditorMediator view = new EditorMediator();
            RegisterMediator(view);
            if (game == null)
            {
                game = CreateGame();
            }
            SilverlightApplicationFacadeHelper.StartGame(game);

            //    Thinking
            WorldUC worldView = SilverlightViewFacade.Helper.GetWorldView(new WorldVOId("MyWorld"));
            view.ViewComponent.SetWorldView(worldView);

            //TODO create helperclasses like screenmanager
            SetScreen(view.ViewComponent);*/
                      
        }
    }

    public class Page_WorldEditor_Out_Command : SimpleCommand
    {
        override public void Execute(INotification notification)
        {
            //switch (notification.Type)
            //{
            //    case EditorMainMenu.BACKBUTTON:
            //        MenuMediator mediator = new MenuMediator(MyFacade.MainPageMediatorName, new MainMenu(), MyFacade.PAGE_MAIN_OUT_COMMAND);
            //        MyFacade.Instance.RegisterMediator(mediator);
            //        MyFacadeHelper.DesktopNavigate(mediator.ViewComponent);
            //        MyFacade.Instance.RemoveMediator(MyFacade.EditorPageMediatorName);
            //        break;
            //    case EditorMainMenu.NEWLEVELBUTTON:
                   
            //        break;
            //}
        }
    }
}
